package com.tool.imp.ap;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.tool.imp.BillVO;
import com.tool.imp.EntryVO;
import com.tool.imp.FieldVO;

/**
 * 测试使用Example
 * 
 * @author Evan.Hu
 * 
 */
public class ApBillVO extends BillVO {
	private static Map<String, FieldVO> fieldMap;

	public ApBillVO() {
		super();
		setList("entries", new ArrayList());
	}

	/**
	 * 分组字段 可用于做归集 <br>
	 * 若不设置，每行记录作为一条数据库对应单据记录
	 * 
	 */
	public String getBizNumberField() {
		return "number";
	}

	public String getTableName() {
		return "T_AR_OtherBill";
	}

	public String getPKField() {
		return "id";
	}

	public Map<String, FieldVO> getFieldMap() {
		return fieldMap;
	}

	static {
		fieldMap = new HashMap<String, FieldVO>();

		// 注册数据字段
		fieldMap.put("id", new FieldVO("id", String.class, "FID"));
		fieldMap.put("number", new FieldVO("number", String.class, "FNumber"));
		fieldMap.put("billDate", new FieldVO("billDate", Date.class, "FBillDate"));
		fieldMap.put("amount", new FieldVO("amount", BigDecimal.class, "FAmount"));
		fieldMap.put("creator", new FieldVO("creator", String.class, "FCreatorID"));
		fieldMap.put("entries", new FieldVO("entries", EntryVO.class, null));

	}

	// ****************************字段set/get方法

	public String getID() {
		return getString("id");
	}

	public void setID(String id) {
		setString("id", id);
	}

	public String getNumber() {
		return getString("number");
	}

	public void setNumber(String number) {
		setString("number", number);
	}

	public Date getBillDate() {
		return getDate("billDate");
	}

	public void setBillDate(Date date) {
		setDate("billDate", date);
	}

	public BigDecimal getAmount() {
		return getBigDecimal("amount");
	}

	public void setAmount(BigDecimal amount) {
		setBigDecimal("amount", amount);
	}

	public String getCreator() {
		return getString("creator");
	}

	public void setCreator(String creator) {
		setString("creator", creator);
	}

	@SuppressWarnings("unchecked")
	public List<ApEntryVO> getEntries() {
		return (List<ApEntryVO>) getList("entries");
	}

	public void setEntries(List<ApEntryVO> entris) {
		setList("entries", entris);
	}

}
